var app2 = new Vue({
	el: "#app-2",
	data: {
		message: '页面加载于 ' + new Date().toLocaleString(),
		msg1: '反转测试',
		msg2: '双向绑定',
		display: true,
		todoList: [
			{ text: '学习 JavaScript' },
			{ text: '学习 Vue' },
			{ text: '整个牛项目' }
		],
		groceryList: [
			{ id: 0, text: '蔬菜' },
			{ id: 1, text: '奶酪' },
			{ id: 2, text: '随便其它什么人吃的东西' }
		]
	},
	methods: {
		reverseMessage: function () {
			this.msg1 = this.msg1.split('').reverse().join('')
		},
		alertMsg: function(msg) {
			alert(msg);
		}
	}
});
// 监听某个数据是否改变
app2.$watch('msg1', function(newValue, oldValue) {
	alert(oldValue + " ===== " + newValue)
});